//
//  String+Category.swift
//  DSWeibo
//
//  Created by liuzhu on 2018/11/14.
//  Copyright © 2018 liuzhu. All rights reserved.
//

import UIKit

extension String{
    
    public func cacheDir()->String{
        let path = NSSearchPathForDirectoriesInDomains(FileManager.SearchPathDirectory.cachesDirectory, FileManager.SearchPathDomainMask.userDomainMask, true).last! as NSString
        return path.appendingPathComponent(self)
    }
    
    func docDir()->String{
        let path = NSSearchPathForDirectoriesInDomains(FileManager.SearchPathDirectory.documentDirectory, FileManager.SearchPathDomainMask.userDomainMask, true).last! as NSString
        return path.appendingPathComponent(self)
    }
    
    func temDir()->String{
        let path = NSTemporaryDirectory() as NSString
        return path.appendingPathComponent(self)
    }
}
